﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

namespace Script.UI.Component
{
    
    public class SingleSlider : HistogramDisplay
    {
        public Slider Sld_Histogram;
       
        public override void Display()
        {
            float fPercent = 0;
            float fDifferenceValue = MaxValue - MinValue * 0.9f;
            if (fDifferenceValue - 0f < 0.00000001)
            {
                fPercent = 0;
            }
            else
            {
                fPercent = (CurrentValue - MinValue * 0.9f) / fDifferenceValue;
            }

            if (Sld_Histogram != null)
            {
                Sld_Histogram.value = fPercent;
            }
            // Debug.LogError($"{fPercent} ,   {CurrentValue},    {MaxValue},   {MinValue}");
        }
    }

    
}

